-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
capture stack traces in worker panics #6
Conversation
72acf8c
to
1b3c69d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. TIL about panic(nil)
lore.
} | ||
} | ||
|
||
g.panicked.CompareAndSwap(nil, &wp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why CompareAndSwap? Is there a risk of setting g.panicked
twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty positive i just wanted to make sure that specifically the first panic sticks, rather than just "any panic who cares"
// nicely with the testing lib, but there doesn't seem to be any good | ||
// way to xfail a golang test. As it happens t.Fatal() just sets a fail | ||
// flag and then calls Goexit() anyway; if we treat nil recover() values | ||
// as Goexit() (guaranteed since 1.21 with the advent of PanicNilError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... realizes what it means that panic(nil)
use to recover()
as nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is some deep lore to how panic(nil)
used to work (and be worked around)
we want to know where panics are happening inside parallelized functions :)